Repunit
In recreational mathematics, a repunit is a number like 11, 111, or 1111 that contains only the digit 1 — a more specific type of repdigit. A repunit prime is a repunit that is also a prime number. Repunit prime Rn is known to be prime for n = 2, 3, 5, 17, 81, 91, 225, 255, 4X5, and Rn is probable prime for n = 5777, 879E, 198E1, 23175, 311407. RXE/19E is a X8-digit prime (XE is the only known prime p such that Rp/(2p+1) is prime). R141 has two 60-digit prime factors, and they are very close. If n is composite, then Rn is also composite (e.g. 2E = 5 × 7, and R2E = 11111111111111111111111111111111111 = 11111 × 1000010000100001000010000100001 = 1111111 × 10000001000000100000010000001), however, when n is prime, Rn can be composite, the first example is R7, although 7 is prime, R7 = 1111111 is not prime, it equals 46E * 2X3E. Theorem If p is prime other than E, then every prime factor of Rp is = 1 mod p. (e.g. both 46E and 2X3E are = 1 mod 7) If p is Sophie Germain prime other than 2, 3 and 5, then Rp is not prime, since Rp must be divisible by 2p+1. (e.g. 1E|RE, 3E|R1E, 4E|R25, 6E|R35, 8E|R45, 11E|R6E, 12E|R75, 16E|R95, 19E|RXE) If p is prime other than 2, 3 and E, then p divides R(p-1), however, some composite numbers c also divide R(c-1), the first such example is 55, which divides R54. For prime p other than 2, 3 and E, the smallest integer n>=1 such that p divides Rn is the period length of 1/p, e.g. none of 1, 11, 111, 1111 and 11111 is divisible by 17, but 111111 is, and the period length of 1/17 is 6: 0.076E45076E45... All repunit composite with prime length except RE are Fermat pseudoprime (also Euler pseudoprime, Euler-Jacobi pseudoprime and strong pseudoprime) base 10. If n is Fermat pseudoprime base 10, then Rn is also Fermat pseudoprime base 10 (thus, there are infinitely many Fermat pseudoprimes base 10). Factorization of repunits R1 = 1 R2 = 11 R3 = 111 R4 = 5 * 11 * 25 R5 = 11111 R6 = 7 * 11 * 17 * 111 R7 = 46E * 2X3E R8 = 5 * 11 * 25 * 75 * 175 R9 = 31 * 111 * 3X891 RX = 11 * E0E1 * 11111 RE = E * 1E * 754E2E41 R10 = 5 * 7 * 11 * 17 * 25 * 111 * EE01 R11 = 1E0411 * 69X3901 R12 = 11 * 157 * 46E * 2X3E * 7687 R13 = R14 = R15 = X9X9XE * 126180EE0EE R16 = R17 = 1111111111111111111 R18 = R19 = R1X = R1E = 3E * 78935EX441 * 523074X3XXE R20 = Properties * Any positive multiple of the repunit Rn contains at least n'' nonzero digits. * The only known numbers that are repunits with at least 3 digits in more than one base simultaneously are 27 (111 in base 5, 11111 in base 2) and 48X7 (111 in base 76, 1111111111111 in base 2). The Goormaghtigh conjecture says there are only these two cases. * Using the pigeon-hole principle it can be easily shown that for each ''n and b'' such that ''n and b'' are relatively prime there exists a repunit in base ''b that is a multiple of n''. To see this consider repunits ''R''1(''b),...,Rn(b''). Because there are ''n repunits but only n''-1 non-zero residues modulo ''n there exist two repunits Ri(b'') and ''Rj(b'') with 1≤''i<''j''≤''n'' such that Ri(b'') and ''Rj(b'') have the same residue modulo ''n. It follows that Rj(b'') - ''Ri(b'') has residue 0 modulo ''n, i.e. is divisible by n''. ''Rj(b'') - ''Ri(b'') consists of ''j - i'' ones followed by ''i zeroes. Thus, Rj(b'') - ''Ri(b'') = ''Rj-''i''(b'') x ''bi . Since n'' divides the left-hand side it also divides the right-hand side and since ''n and b'' are relatively prime ''n must divide Rj-''i''(b''). * The Feit–Thompson conjecture is that ''Rq(p'') never divides ''Rp(q'') for two distinct primes ''p and q''. * Using the Euclidean Algorithm for repunits definition: ''R''1(''b) = 1; Rn(b'') = ''Rn-1(b'') x ''b + 1, any consecutive repunits Rn-1(b'') and ''Rn(b'') are relatively prime in any base ''b for any n''. * If ''m and n'' are relatively prime, ''Rm(b'') and ''Rn(b'') are relatively prime in any base ''b for any m'' and ''n. The Euclidean Algorithm is based on gcd(m'', ''n) = gcd(m'' - ''n, n'') for ''m > n''. Similarly, using ''Rm(b'') - ''Rn(b'') × ''bm-''n'' = Rm-''n''(b''), it can be easily shown that ''gcd(Rm(b''), ''Rn(b'')) = ''gcd(Rm-''n''(b''), ''Rn(b'')) for ''m > n''. Therefore if ''gcd(m'', ''n) = 1, then gcd(Rm(b''), ''Rn(b'')) = ''R''1(''b) = 1. * The remainder of Rn(10) modulo E is equal to the remainder of n modulo E. * The only repunit prime in base 4 is 5 (=114). * The only repunit prime in base 8 is 61 (=1118). * The only repunit prime in base 14 is 15 (=1114) * The only repunit prime in base 30 is 31 (=1130). * There are no repunit primes in base 9, 21, 28, 41, 54, ...